package com.zhny.aiot.rtu.flow.plugin.model;

import com.zhny.aiot.plugin.ActionValue;
import com.zhny.aiot.plugin.PropertyValue;
import com.zhny.aiot.plugin.model.*;
import lombok.Data;

@Data
public class FlowStoreEntry extends StoreEntity {
    @PropertyValue(alias = "瞬时流量",description = "瞬时流量值",unit = "m3/h",icon=IconConstract.Flow,variableType=VariableType.Numerical,actions={
            @ActionValue(name=Operate.Check, commandCode="queryFlow", eventType=EventType.Click)
    })
    private String flow;
    @PropertyValue(alias = "累计流量",description = "累计流量值",unit = "m3",icon=IconConstract.Flow,variableType=VariableType.Numerical,actions={
            @ActionValue(name=Operate.Check, commandCode="queryFlow", eventType=EventType.Click)
    })
    private String totalFlow;

    @PropertyValue(alias = "累计热量",description = "累计热量",unit = "KWh",icon=IconConstract.Other,variableType=VariableType.Numerical,actions={
            @ActionValue(name=Operate.Check, commandCode="queryFlow", eventType=EventType.Click)
    })
    private String totalHeat;

    @PropertyValue(alias = "累计冷量",description = "累计冷量",unit = "KWh",icon=IconConstract.Other,variableType=VariableType.Numerical,actions={
            @ActionValue(name=Operate.Check, commandCode="queryFlow", eventType=EventType.Click)
    })
    private String totalCapacity;

    @PropertyValue(alias = "供水温度",description = "供水温度",unit = "°C",icon=IconConstract.Other,variableType=VariableType.Numerical,actions={
            @ActionValue(name=Operate.Check, commandCode="queryFlow", eventType=EventType.Click)
    })
    private String waterSupplyTemperature;

    @PropertyValue(alias = "回水温度",description = "回水温度",unit = "°C",icon=IconConstract.Other,variableType=VariableType.Numerical,actions={
            @ActionValue(name=Operate.Check, commandCode="queryFlow", eventType=EventType.Click)
    })
    private String returnWaterTemperature;

    @Override
    public String toString(){
        StringBuilder builder = new StringBuilder ();
        builder.append ("flow:");builder.append (flow);builder.append (";");
        builder.append ("totalFlow:");builder.append (totalFlow);builder.append (";");
        builder.append ("totalHeat:");builder.append (totalHeat);builder.append (";");
        builder.append ("totalCapacity:");builder.append (totalCapacity);builder.append (";");
        builder.append ("waterSupplyTemperature:");builder.append (waterSupplyTemperature);builder.append (";");
        builder.append ("returnWaterTemperature:");builder.append (returnWaterTemperature);builder.append (";");

        return builder.toString ();
    }

}
